package com.demo.systemmonitor.data;

/**
 * CPU静态信息模型类，存储CPU型号、核心数等不常变化的数据
 */
public class CpuInfo {
    private String model;                // CPU型号
    private String baseSpeed;            // 基准频率
    private int socket;                  // 插槽数量
    private int cores;                   // 核心数
    private int logicalProcessors;       // 逻辑处理器数量
    private boolean isVirtualizationEnabled;  // 是否启用虚拟化
    private String l1Cache;              // L1缓存大小
    private String l2Cache;              // L2缓存大小
    private String l3Cache;              // L3缓存大小

    public CpuInfo(String model, String baseSpeed, int socket, int cores,
                   int logicalProcessors, boolean isVirtualizationEnabled,
                   String l1Cache, String l2Cache, String l3Cache) {
        this.model = model;
        this.baseSpeed = baseSpeed;
        this.socket = socket;
        this.cores = cores;
        this.logicalProcessors = logicalProcessors;
        this.isVirtualizationEnabled = isVirtualizationEnabled;
        this.l1Cache = l1Cache;
        this.l2Cache = l2Cache;
        this.l3Cache = l3Cache;
    }

    // Getter方法
    public String getModel() {
        return model;
    }

    public String getBaseSpeed() {
        return baseSpeed;
    }

    public int getSocket() {
        return socket;
    }

    public int getCores() {
        return cores;
    }

    public int getLogicalProcessors() {
        return logicalProcessors;
    }

    public boolean isVirtualizationEnabled() {
        return isVirtualizationEnabled;
    }

    public String getL1Cache() {
        return l1Cache;
    }

    public String getL2Cache() {
        return l2Cache;
    }

    public String getL3Cache() {
        return l3Cache;
    }

    // Setter方法
    public void setModel(String model) {
        this.model = model;
    }

    public void setBaseSpeed(String baseSpeed) {
        this.baseSpeed = baseSpeed;
    }

    public void setSocket(int socket) {
        this.socket = socket;
    }

    public void setCores(int cores) {
        this.cores = cores;
    }

    public void setLogicalProcessors(int logicalProcessors) {
        this.logicalProcessors = logicalProcessors;
    }

    public void setVirtualizationEnabled(boolean virtualizationEnabled) {
        isVirtualizationEnabled = virtualizationEnabled;
    }

    public void setL1Cache(String l1Cache) {
        this.l1Cache = l1Cache;
    }

    public void setL2Cache(String l2Cache) {
        this.l2Cache = l2Cache;
    }

    public void setL3Cache(String l3Cache) {
        this.l3Cache = l3Cache;
    }
}
